<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var arr=[66,166,55,7,23,9988,-3];
    var newArr=arr.sort(function (x,y){return x-y});
    document.write(newArr)
</script>
</body>
</html>